package com.team.six.bluecatshop.service;

import com.team.six.bluecatshop.domain.Comment;
import com.team.six.bluecatshop.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public Comment selectCommentByProductId(String productId) {
        return commentMapper.selectCommentByProductId(productId);
    }

    @Override
    public int updateByPrimaryKeySelective(Comment comment) {
        int i = commentMapper.updateByPrimaryKeySelective(comment);
        return i;
    }

    @Override
    public int insert(Comment comment) {
        return commentMapper.insert(comment);
    }

    @Override
    public Comment selectCommentByHistoryId(String historyId) {
        return commentMapper.selectCommentByHistoryId(historyId);
    }

    @Override
    public List<Comment> selectCommentsByCustomerId(String customerId) {
        return commentMapper.selectCommentsByCustomerId(customerId);
    }

    @Override
    public Comment findById(String commentId) {
        return commentMapper.selectByPrimaryKey(commentId);
    }
}
